<template>
  <el-container class="table-container">
    <el-header>
      <div style="float: left">left</div>
      <div style="float: right">right</div>
    </el-header>
    <el-main>
      <Table :table-columns="tableColumns" :table-datas="tableDatas"></Table>
    </el-main>
    <el-footer>
      <TablePage :page-size="pageSize" :total-size="totalSize"></TablePage>
    </el-footer>
  </el-container>
</template>

<script>
	import TablePage from '@/components/Table/TablePage'
	import Table from '@/components/Table/Table'
	import {devConfig} from '@/http/config'

	export default {
		name: 'TableContainer',
		props: {
			// 总数量
			totalSize: {
				type: Number,
				required: true
			},
			// 需要显示的列
			tableColumns: {
				type: Array,
				required: true
			},
			// 表中数据
			tableDatas: {
				type: Array,
				required: true
			}
		},
		components: {
			Table,
			TablePage
		},
		data() {
			return {
				pageSize: devConfig.pageSize
			}
		}
	}
</script>

<style scoped>
  .table-container {
    display: block;
    height: 100%;
  }

  .el-header, .el-footer {
    text-align: center;
    background-color: #B3C0D1;
  }

  .el-aside {
    background-color: #D3DCE6;
  }

  .el-main {
    background-color: #E9EEF3;
    height: 80%;
  }

</style>
